package com.dhcc.bpm.modules.log.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dhcc.bpm.modules.log.entity.GatewayLogMinute;
import com.dhcc.bpm.modules.log.mapper.GatewayLogMinuteMapper;
import com.dhcc.bpm.modules.log.service.IGatewayLogMinuteService;
import com.dhcc.bpm.modules.log.vo.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.AsyncResult;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.concurrent.Future;

/**
 * @ClassName GatewayLogMinuteServiceImpl.class
 * @Description  网关访问记录分钟表 服务实现类
 * @Author xiaFaYu
 * @Date 2019-12-16 14:16
 * @Version V1.0
 * @Copyright: 2020 东华软件 . All rights reserved.
 */
@Service
public class GatewayLogMinuteServiceImpl extends ServiceImpl<GatewayLogMinuteMapper, GatewayLogMinute> implements IGatewayLogMinuteService {
	@Autowired
	private GatewayLogMinuteMapper gatewayLogMinuteMapper;
	/**
	 * @Description 分页查询
	 * @Author xiafayu
	 * @Date 2020/2/24 15:38
	 * @param page
	 * @param gatewayLogMinute
	 * @return com.baomidou.mybatisplus.core.metadata.IPage<com.dhcc.bpm.modules.log.vo.GatewayLogMinuteVO>
	 **/
	@Override
	public IPage<GatewayLogMinuteVO> selectGatewayLogMinutePage(IPage<GatewayLogMinuteVO> page, GatewayLogMinuteVO gatewayLogMinute) {
		return page.setRecords(baseMapper.selectGatewayLogMinutePage(page, gatewayLogMinute));
	}

	/**
	 * @Description 查询
	 * @Author xiafayu
	 * @Date 2020/2/24 15:38
	 * @param gatewayLogMinuteVO
	 * @return java.util.List<com.dhcc.bpm.modules.log.vo.TradeVolumnVo>
	 **/
	@Override
	public List<TradeVolumnVo> countGatewayLogMinuteByDate(GatewayLogMinuteVO gatewayLogMinuteVO) {
		return gatewayLogMinuteMapper.countGatewayLogMinuteByDate(gatewayLogMinuteVO);
	}

	@Override
	public List<TradeVolumnVo> countGatewayLogMinuteByDateHour(GatewayLogMinuteVO gatewayLogMinute) {
		return baseMapper.countGatewayLogMinuteByDateHour(gatewayLogMinute);
	}

	@Override
	public List<TradeVolumnVo> countGatewayLogMinuteByTime(GatewayLogMinuteVO gatewayLogMinute) {
		return baseMapper.countGatewayLogMinuteByTime(gatewayLogMinute);
	}

	@Override
	public IPage<TradeVolumnVo> countGatewayLogMinuteByTimeByPage(IPage<TradeVolumnVo> page, GatewayLogMinuteVO gatewayLogMinute) {
		return page.setRecords(baseMapper.countGatewayLogMinuteByTimeByPage(page,gatewayLogMinute));
	}


	/**
	 * @Description 查询
	 * @Author xiafayu
	 * @Date 2020/2/24 15:38
	 * @param gatewayLogMinute
	 * @return com.dhcc.bpm.modules.log.vo.TradeVolumnVo
	 **/
	@Override
	public TradeVolumnVo tradingVolume(GatewayLogMinute gatewayLogMinute) {
		return gatewayLogMinuteMapper.tradingVolume(gatewayLogMinute);
	}
	/**
	 * @Description 统计
	 * @Author daina
	 * @Date 18:43 2020/4/22
	 * @param appApiViewVo
	 * @return java.util.List<com.dhcc.bpm.modules.log.vo.AppApiViewVo>
	 **/
	@Override
	public List<AppApiViewVo> apiChartDataByMinute(AppApiViewVo appApiViewVo) {
		return gatewayLogMinuteMapper.apiChartDataByMinute(appApiViewVo);
	}
	@Override
	public List<AppApiViewVo> apiChartByMinute(AppApiViewVo appApiViewVo) {
		return gatewayLogMinuteMapper.apiChartByMinute(appApiViewVo);
	}

	/**
	 * @Description 查询
	 * @Author xiafayu
	 * @Date 2020/2/24 15:38
	 * @param page
	 * @param apiRankVo
	 * @return com.baomidou.mybatisplus.core.metadata.IPage<com.dhcc.bpm.modules.log.vo.OrgaRankVo>
	 **/
	@Override
	public IPage<OrgaRankVo> countOrgaNum(IPage<Object> page, OrgaRankVo apiRankVo) {
		return gatewayLogMinuteMapper.countOrgaNum(page, apiRankVo);
	}

	/**
	 * @Description 查询
	 * @Author xiafayu
	 * @Date 2020/2/24 15:38
	 * @param vo
	 * @return java.util.List<com.dhcc.bpm.modules.log.vo.AppApiViewVo>
	 **/
	@Override
	public List<AppApiViewVo> countProductByDate(AppApiViewVo vo) {
		return gatewayLogMinuteMapper.countProductByDate(vo);
	}

	/**
	 * @Description 查询
	 * @Author xiafayu
	 * @Date 2020/2/24 15:39
	 * @param gatewayLogMinuteVO
	 * @return java.util.List<com.dhcc.bpm.modules.log.vo.TradeAppVo>
	 **/
	@Override
	public List<TradeAppVo> selectApiCountByDay(GatewayLogMinuteVO gatewayLogMinuteVO) {
		return gatewayLogMinuteMapper.selectApiCountByDay(gatewayLogMinuteVO);
	}

	/**
	 * @Description 查询
	 * @Author xiafayu
	 * @Date 2020/2/24 15:39
	 * @param gatewayLogMinuteVO
	 * @return java.util.List<com.dhcc.bpm.modules.log.vo.TradeAppVo>
	 **/
	@Override
	public List<TradeAppVo> selectCountByDay(GatewayLogMinuteVO gatewayLogMinuteVO) {
		return gatewayLogMinuteMapper.selectCountByDay(gatewayLogMinuteVO);
	}
}
